import parameterized
import app
import json
import unittest


def read_json():
    lis_data = []
    # 读取json数据
    file = f"{app.dir}/data/login_data.json"
    with open(file, encoding="utf-8") as f:
        res = json.load(f)
        for i in res:
            login_da = i.get("login_da")

            lis_data.append(login_da)
    return lis_data


if __name__ == '__main__':
    print(read_json())


# 公共断言

def duanyan(benshen, response, status_code=200, success=True, code=10000, message="操作成功！"):
    benshen.assertEqual(status_code, response.status_code)
    benshen.assertEqual(success, response.json().get("success"))
    benshen.assertEqual(code, response.json().get("code"))
    benshen.assertEqual(message, response.json().get("message"))
